﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Domain.Entities.Auditing;
using YaAppoint.Appointments;
using YaAppoint.Appointments.Pools;

namespace YaAppoint
{
    public class Appointment :FullAuditedEntity<Guid>
    {
        /// <summary>
        /// 活动
        /// </summary>
        public virtual bool IsActive { get; set; } = true;

        /// <summary>
        /// 显示名称
        /// </summary>
        public string DisplayName
        {
            get 
            {
                return $"{Pool.Device.Name} {Pool.Date.ToString("MM月dd日")} {Pool.StartTime.ToString("tt hh:mm ")}-{Pool.EndTime.ToString("hh:mm")}";
            }
        }

        /// <summary>
        /// 预约编号
        /// </summary>
        [MaxLength(15)]
        public virtual string Number { get; set; }

        /// <summary>
        /// 备注
        /// </summary> 
        public virtual string? Remark { get; set; }

        /// <summary>
        /// 申请项目
        /// </summary>
        public virtual List<ExamApplication> ExamApplications { get; set; }

        /// <summary>
        /// 预约状态
        /// </summary>
        public virtual AppointmentStatus Status { get; set; }
        
        /// <summary>
        /// 号池
        /// </summary>
        public virtual Pool Pool { get; set; }

        /// <summary>
        /// 号池Id
        /// </summary>
        public virtual Guid PoolId { get; set; }
    }
}
